package com.bgs.controller;

import com.bgs.pojo.DepartmentVo;
import com.bgs.pojo.EmployeeVo;
import com.bgs.pojo.EnterpriseVo;
import com.bgs.service.MailService;
import com.bgs.tool.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/go")
@CrossOrigin
public class MailController {

    @Autowired
    private MailService mailService;

    @PostMapping("/listme/{eid}")
    public R getMe(@PathVariable Integer eid){
        List<EnterpriseVo> list=mailService.getMe(eid);
        return R.ok().data("list",list);
    }

    @PostMapping("/listgo")
    public R getgo(Integer enterId){
        return mailService.getgo(enterId);
    }

    @PostMapping("/listlike/{departmentid}")
    public R getLike(@PathVariable("departmentid") Integer departmentid){
        List<EmployeeVo> list=mailService.getLike(departmentid);
        return R.ok().data("list",list);
    }

    @PostMapping("/listPeo")
    public R getPeo(Integer eid){
        List<EmployeeVo> list=mailService.getPeo(eid);
        return R.ok().data("list",list);
    }
}
